<div class="row" style="border-bottom: 10px solid #EFEFEF;padding:10px;">
	<div class="col-lg-8">
		<div class="ukefu-measure">
			<div class="ukefu-bt"> 
				<div	class="layui-icon ukewo-btn ukefu-content-ind"><img src="/images/weixin.jpg" style="width:60px;height:60px;"></div>
				<div class="ukefu-bt-text">
					<div class="ukefu-bt-text-title"
						style="font-weight:400;font-size:24px;border-bottom:1px solid #dedede;">
							${snsAccount.name!''}
							<span style="font-size:15px;color:#AAAAAA;">公众号创建时间：${snsAccount.createtime!?string("yyyy-MM-dd HH:mm:ss")}</span>
					</div>
					<div class="ukefu-bt-text-content" style="">${snsAccount.name!''}</div>
				</div>
			</div>
		</div>
	</div>
	<div class="col-lg-4">
		<form class="layui-form" action="/admin/weixin/update.html"	method="post">
			<div class="layui-form-item">
				<label class="layui-form-label">
					人工坐席：
				</label>
				<div class="layui-input-block ukefu-agent-switch" style="padding-top:0px;">
					<input type="checkbox" name="switch" <#if snsAccount.agent?? && snsAccount.agent == true>checked</#if> lay-filter="agent" lay-skin="switch" value="1" lay-text="开启|关闭">
				</div>
			</div>
		</form>
	</div>
</div>
<div class="row" style="border-bottom: 10px solid #EFEFEF;padding:10px;">
	<div class="col-lg-12">
		<span style="font-weight:600;">接口地址：</span>${schema!''}://${hostname!''}<#if port?? && port != '80'>:${port?string('###')}</#if>/im/weixin/${snsAccount.snsid!''}
		<span style="font-weight:600;margin-left:50px;">Token：</span>${snsAccount.token!''}
		<span style="font-weight:600;margin-left:50px;">AppID：</span>${snsAccount.appkey!''}	
	</div>
</div>
<div class="ukefu-tab-title" style="margin-left: 0px;">
	<#include "/admin/channel/weixin/include/top.html">
</div>
<div class="row" style="border-bottom: 10px solid #EFEFEF;padding:10px;">
	<div class="col-lg-12">
		<div class="row">

		</div>
		<h1 class="site-h1" style="border-top:1px solid #e6e6e6;">
			粉丝列表<#if weiXinUserCount??>（${weiXinUserCount!0}），关注数（${subscribeCount!0}），取消关注数（${unSubscribeCount!0}）</#if>
			<span style="float:right;">
				<a type="button" class="layui-btn  layui-btn-sm " data-toggle="tip" title="确定同步用户列表吗？若用户数量较多，需要的时间较多，请稍等"  href="/admin/weixin/fans/refresh.html?id=${snsAccount.id!''}">同步所有用户信息</a>
			</span>
		</h1>
		<div class="row">
			<table class="layui-table" lay-skin="line">
				<colgroup>
					<col width="20%">
					<col width="5%">
					<col width="10%">
					<col width="15%">
					<col width="15%">
					<col width="20%">
					<col width="1%">
					<col>
				</colgroup>
				<thead>
					<tr>
						<th>昵称</th>
						<th>性别</th>
						<th>国家</th>
						<th>省份</th>
						<th>城市</th>
						<th>关注时间</th>
						<th nowrap="nowrap">状态</th>
					</tr>
				</thead>
				<tbody>
					<#if weiXinUserList?? && weiXinUserList.content?? && weiXinUserList.content?size gt 0>
					<#list weiXinUserList.content as weiXinUser>
					<tr>
						<td>
							<img src="${weiXinUser.headimgurl!''}" style="width:48px;height:48px;" id="headimg_${weiXinUser.id!''}">
							<div style="margin-left:5px;margin-top:0px;display:inline;">
								${weiXinUser.nickname!''}
							</div>
						</td>
						<td>${weiXinUser.sex!''}</td>
						<td>${weiXinUser.country!''}</td>
						<td>${weiXinUser.province!''}</td>
						<td>${weiXinUser.city!''}</td>
						<td>${weiXinUser.subTime?string('yyyy-MM-dd HH:mm:ss')}</td>
						<td>
							<#if weiXinUser.subscribe == true>
								<i class="layui-icon" style="color:#19a55d;" title="已关注">&#xe605;</i>
							<#else>
								<i class="layui-icon" style="color:red;" title="已取消关注">&#x1006;</i>
							</#if>
						</td>
					</tr>
					</#list>
					<#else>
					<tr>
						<td colspan="20" style="height:400px;">
							<div class="ukefu-empty">
								<i class="layui-icon">&#xe63a;</i>
								<div style="">当前没有关注公众号的粉丝</div>
							</div>
						</td>
					</tr>
					</#if>
				</tbody>
			</table>
		</div>
	</div>
</div>
<div class="row" style="padding:5px;">
	<div class="col-lg-12" id="page" style="text-align:center;"></div>
</div>

<script>
	layui.use('form', function() {
		var form = layui.form;
		form.render(); //更新全部
		form.on("switch(agent)" , function(data){
			if(data.elem.checked){
				loadURL("/admin/weixin/enable.html?id=${snsAccount.id!''}" , null , function(){
					top.layer.alert('启用人工坐席', {icon: 1});
				});
			}else{
				loadURL("/admin/weixin/disable.html?id=${snsAccount.id!''}" , null , function(){
					top.layer.alert('关闭人工坐席', {icon: 1});
				});
			}
		})
	});
	layui.use('element', function(){
		var element = layui.element;
	});
	layui.use(['laypage', 'layer'], function(){
		  var laypage = layui.laypage
		  ,layer = layui.layer;

	<#if  msg?? &&  msg =="post_err" >
		layer.alert('同步粉丝列表失败', {icon: 2});
	<#elseif  msg?? &&  msg =="post_success" >
		layer.alert('同步粉丝列表成功', {icon: 1});
	<#elseif  msg??>
		layer.alert('${msg}', {icon: 2});
	</#if>

		  laypage.render({
				elem: 'page'
				,pages: <#if weiXinUserList??>${weiXinUserList.totalPages}<#else>0</#if> //总页数
				,curr:<#if weiXinUserList??>${weiXinUserList.number+1}<#else>0</#if>
				,groups: 5 //连续显示分页数
				,jump:function(data , first){
					if(!first){
						location.href = "/admin/weixin/fans.html?id=${snsAccount.id!''}&p="+data.curr ;
					}
				}
		   });
	});
</script>